<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
Use App\Comment;
use App\Http\Requests;
use Response;

class CommentsController extends Controller
{

    public function store(Requests\PostCommentRequest $request)
    {
        $comment = Comment::create(array_merge($request->all(),['user_id'=>\Auth::user()->id]));
//        return redirect()->action('PostsController@show',['id'=>$request->get('discussion_id')]);
        if($comment)
            $res['status'] = 1;
        else
            $res['status'] = -1;
        return Response::json($res);
    }
}
